﻿using Nop.Core.Plugins;
using Nop.Plugin.Misc.Reservations.Data;
using Nop.Services.Common;
using System.Web.Routing;

namespace Nop.Plugin.Misc.Reservations 
{
    public class ReservationPlugin : BasePlugin, IMiscPlugin
    {

        #region Private Fields

        private readonly ReservationObjectContext _context;

        #endregion

        #region Ctor

        public ReservationPlugin(ReservationObjectContext context)
        {
            _context = context;
        }

        #endregion

        public override void Install()
        {
            _context.Install();

            base.Install();
        }

        /// <summary>
        /// Uninstall plugin
        /// </summary>
        public override void Uninstall()
        {
            _context.Uninstall();

            base.Uninstall();
        }

        /// <summary>
        /// Gets a route for provider configuration
        /// </summary>
        /// <param name="actionName">Action name</param>
        /// <param name="controllerName">Controller name</param>
        /// <param name="routeValues">Route values</param>
        public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues)
        {
            actionName = "Configure";
            controllerName = "Reservation";
            routeValues = new RouteValueDictionary() { { "Namespaces", "Nop.Plugin.Misc.Reservations.Controllers" }, { "area", null } };
        }
    }
}
